package com.example.demo.model.valueObject;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/**
 * @Description:用户登录
 * @Author: STY
 * @Date: 2021/3/6
 *
 */
@Data
public class UserLogin implements UserDetails {
    private String id;
    private String name;
    private String password;
    private String authority;
    private List<GrantedAuthority> authorities;//权限
    @Override
    public String getUsername() {
        return id;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
